package com.zking.entity;

import com.sun.istack.internal.NotNull;
import lombok.Data;
import org.hibernate.validator.constraints.Range;
import org.omg.CORBA.PRIVATE_MEMBER;
import org.springframework.data.annotation.Id;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.lang.annotation.Documented;
import java.util.Date;
import java.util.stream.IntStream;

/**
 * 用户表
 * CREATE TABLE `customent` (
 *   `id` bigint(13) NOT NULL COMMENT 'id',
 *   `name` varchar(255) DEFAULT NULL COMMENT 'name',
 *   `sex` varchar(10) DEFAULT NULL,
 *   `age` int(11) DEFAULT NULL,
 *   `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
 *   `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
 *   PRIMARY KEY (`id`)
 * ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='学生表';
 */
@Data
public class Customent implements Serializable {
    @Id
    private Integer id;
    @NotBlank
    private String name;
    private String sex;
    @Range(min=10,max=100)
    private int  age;
    private Date createdAt;
    private Date updatedAt;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    public Date getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(Date updatedAt) {
        this.updatedAt = updatedAt;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", sex='" + sex + '\'' +
                ", age=" + age +
                ", createdAt=" + createdAt +
                ", updatedAt=" + updatedAt +
                '}';
    }
}
